package com.wk.worksetter.db

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.wk.worksetter.BaseApplication
import com.wk.worksetter.DATABASE_NAME

/**
 * @author peng
 * @date 2021/1/28
 * 说明
 */
@Database(entities = [WorkEntity::class],version = 1,exportSchema = false)
abstract class WorkDatabase : RoomDatabase(){

    abstract val articleDao : WorkDao

    companion object {
        val instance: WorkDatabase by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
            Room.databaseBuilder(BaseApplication.ins,WorkDatabase::class.java, DATABASE_NAME).build()
        }
    }

}